package com.wxg.other.collections;

import java.util.Map;

/**
 * 示例来自“ON JAVA 中文版”基础卷 ch12.11 新特性：记录（record）类型
 */

record Employee(String name, int id) {
}

public class BasicRecord {
    public static void main(String[] args) {
        var bob = new Employee("Bob Dobbs", 11);
        var dot = new Employee("Dorothy Gale", 9);
        // bob.id = 12;
        System.out.println(bob.id());
        System.out.println(bob.name());
        System.out.println(bob);
        var map = Map.of(bob, "A", dot, "B");
        System.out.println(map);
    }
}
